//
//  GztSpaceCell.swift
//  ZYA
//
//  Created by 邱仙凯 on 2024/12/3.
//  Copyright © 2024 zwb. All rights reserved.
//

import UIKit
 
class GztSpaceCell: UICollectionViewCell {
    
    var bg:UIView = {
        let v = UIView()
        v.backgroundColor = UIColor(kshex:"#f9f9f9")
        v.layer.cornerRadius = 8
        v.layer.masksToBounds = true
        return v
    }()
    var img: UIImageView = {
        let img = UIImageView()
        return img
    }()
    var title: UILabel = {
        let lab :UILabel = UILabel()
        lab.font = UIFont.boldSystemFont(ofSize: 18)
        lab.numberOfLines = 2
        return lab
    }()
    
    
    convenience required init(coder : NSCoder){
        self.init()
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        self.initUtil()
    }
    
    func initUtil() {
         
        self.contentView.addSubview(bg)
        
        img.layer.cornerRadius = 8
        img.layer.masksToBounds = true
        bg.snp.makeConstraints { (make) in
            make.left.equalTo(self.contentView)
            make.right.equalTo(self.contentView)
            make.top.equalTo(self.contentView)
            make.bottom.equalTo(self.contentView).offset(-10)
        }
        
        
        bg.addSubview(img)
        img.snp.makeConstraints { (make) in
            make.edges.equalTo(bg)
        }
        bg.addSubview(title)
        title.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(15)
            make.centerY.equalTo(bg)
        }
       
        
        
    }
}
